import { Address, Boolean, Code, CreateDate, Date, DateTime, Digdit, Entity, Jsonb, MemberId, Mobile, Price, PrimaryUuid, Realname, Remark, Time, Title, UpdateDate, Uuid } from "@sker/core";

@Entity({
    name: 'kd_order'
})
export class KdOrder {
    @PrimaryUuid()
    id: string;

    @MemberId({ comment: '下单人' })
    member_id: string;

    @Realname({ nullable: true, comment: '寄件人姓名' })
    from_realname: string;

    @Mobile({ nullable: true, comment: '寄件人电话' })
    from_mobile: string;

    @Code({ nullable: true })
    from_province: string;

    @Code({ nullable: true })
    from_province_code: string;

    @Code({ nullable: true })
    from_city: string;

    @Code({ nullable: true })
    from_city_code: string;

    @Code({ nullable: true })
    from_area: string;

    @Code({ nullable: true })
    from_area_code: string;

    @Code({ nullable: true })
    from_street: string;

    @Code({ nullable: true })
    from_street_code: string;

    @Address({ nullable: true, comment: '寄件人地址' })
    from_address: string;

    @Realname({ nullable: true, comment: '收件人姓名' })
    to_realname: string;

    @Mobile({ nullable: true, comment: '收件人电话' })
    to_mobile: string;

    @Code({ nullable: true })
    to_province: string;

    @Code({ nullable: true })
    to_province_code: string;

    @Code({ nullable: true })
    to_city: string;

    @Code({ nullable: true })
    to_city_code: string;

    @Code({ nullable: true })
    to_area: string;

    @Code({ nullable: true })
    to_area_code: string;

    @Code({ nullable: true })
    to_street: string;

    @Code({ nullable: true })
    to_street_code: string;

    @Address({ nullable: true, comment: '收件人地址' })
    to_address: string;

    @Code({ comment: '上门取件0、网点自寄1', default: '1' })
    type: string;

    @Date({ comment: '预约日期，上门取件必填', nullable: true })
    date: Date;

    @Code({ comment: '取件时间范围，上门取件必填，如xx:xx-xx:xx', nullable: true })
    times: string;

    @Digdit({ default: 0 })
    cui_count: number;

    @Time({ nullable: true })
    take_start: string;

    @Time({ nullable: true })
    take_end: string;

    @Title({ comment: '物品名称', nullable: true })
    good_title: string;

    @Digdit({ comment: '单位为g', default: 0 })
    good_weight: number;

    @Digdit({ comment: '长，单位cm', default: 0 })
    good_l: number;

    @Digdit({ comment: '宽，单位cm', default: 0 })
    good_w: number;

    @Digdit({ comment: '高，单位cm', default: 0 })
    good_h: number;

    @Digdit({ comment: '体积，单位cm^3', default: 0 })
    good_v: number;

    @Digdit({ comment: '件数', default: 1 })
    good_count: number;

    @Remark({ comment: '给快递员捎话', nullable: true })
    remark: string;

    @Code({ comment: '寄付现结0,到付1,寄付月结2', default: '0' })
    pay_type: string;

    @Price({ comment: '实际货物价值', nullable: true })
    good_price: number;

    @Price({ comment: '保费', default: 0 })
    price: number;

    @Jsonb({ comment: '增值福利' })
    attachs: any[];

    @Code({ comment: '服务码，取货码' })
    code: string;

    @Code({ comment: '订单状态' })
    status: string;

    @Remark({ comment: '取消原因', nullable: true })
    cancel_reason: string;

    @DateTime({ comment: '取消时间' })
    cancel_time: Date;

    @Uuid({ comment: '代理ID', nullable: true })
    agent_id: string;

    @Uuid({ comment: '网点ID', nullable: true })
    shop_id: string;

    // 套餐
    @Uuid({ comment: '套餐ID', nullable: true })
    comp_id: string;

    @Uuid({ comment: '快递公司ID', nullable: true })
    trans_comp_id: string;

    @Uuid({ comment: '快递员', nullable: true })
    shop_member_id: string;

    @Code({ comment: '支付单号', nullable: true })
    tid: string;

    @Code({ comment: '运单号', nullable: true })
    transn: string;

    @Boolean({ comment: '是否开票' })
    has_invoice: boolean;

    @Code({ comment: '支付状态', nullable: true })
    pay_status: string;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;
}